//
//  UIImage+Extension.h
//  黑马微博
//
//  Created by apple on 14-7-3.
//  Copyright (c) 2014年 heima. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "HZZImageModel.h"

@interface UIImage (Extension)

+ (UIImage*)createImageWithColor:(UIColor*)color;

+ (UIImage *)resizableImageWithName:(NSString *)imageName;

///根据目标尺寸生成新的图片
- (UIImage *)imageByScalingToSize:(CGSize)targetSize;

///根据比例系数生成新的图片
- (UIImage *)imageByScalingToPercent:(CGFloat)percent;

///通过view  获取图片
+ (UIImage *)snapshotViewWithInputView:(UIView *)view;

///截取图片 rect 单位像素
+ (UIImage *)getImageFromImage:(UIImage *)image withRect:(CGRect)rect;

//合成图片
+ (UIImage *)syntheticImages:(CGSize)imageSize imageName:(NSString *)imageStr backgroundImage:(UIImage *)backgroundImage;



//转换为灰度图
+ (UIImage *)convertToGrayscale:(UIImage *)source;

///创建灰色复制  *透明色会变成黑色
+ (UIImage *)createGrayCopy:(UIImage *)source;


//image 旋转
- (UIImage *)fixOrientation;


///获取imagePath
+ (NSString *)getImagePath:(HZZImageModel *)imageModel;


@end
